import '../bean/requesterror_bean.dart';
import '../utils/tools/errorhandle_tool.dart';
import '../utils/widget/toast_widget.dart';
import '../model/wirelesstm_model.dart';
import '../bean/wirelesstm_bean.dart';
import 'base_vm.dart';

class WirelessTmVM extends BaseVM {

  /// 获取无线无缘测温信息
  /// * [context] 必填|上下文
  /// * [par] Map|必填|请求参数
  /// * [title] String|选填|提示文案
  getWirelessTmInfo(context, par, {String title = '正在加载...'}) async {
    // 开启加载动画
    ToastWidget.loading();
    try {
      List<WirelesstmBean> res = await WirelessTm.reqWirelessTmInfo(par);
      // 关闭动画
      ToastWidget.closeToast();
      return res;
    } on RequestErrorBean catch (e) {
      return errorHandle(context, e);
    }
  }
}
